<template>
  <div class="header">
    <span class="menu" @click="panelChange">
      <Icon type="md-menu"/>
    </span>
    <span class="logo">{{ this.$store.state.title }}</span>
    <div class="right">
      {{ user }}
      <span class="exit" @click="exit">退出</span>
    </div>
  </div>
</template>

<script>
import cookie from 'js-cookie'

export default {
  data() {
    return {}
  },
  props: {
    panelChange: Function
  },
  components: {},
  computed: {
    user: function() {
      return cookie.get('user')
    }
  },
  methods:{
    exit: function() {
      cookie.remove('user')
      cookie.remove('token')
      this.$router.push('/')
    },
  }
}
</script>

<style lang="less" rel="stylesheet/less" scoped>
.header {
  width: 100vw;
  height: 60px;
  line-height: 60px;
  font-size: 22px;
  background-color: #fff;
  padding: 0 210px;
  border-bottom: 1px solid #dcdfe6;
  // box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  .menu {
    cursor: pointer;
    font-size: 30px;
    margin-right: 15px;
  }
  .logo {
    font-family: 'ZefaniStencil-Regular';
    color: #2d8cf0;
    font-size: 21px;
  }
  .right {
    float: right;
    font-size: 22px;
    .exit {
      cursor: pointer;
      padding-left: 25px;
    }
  }
}
</style>
